﻿using UTSDAL.EntityFramework.DAO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;

namespace UTSTestHarness
{
    
    
    /// <summary>
    ///This is a test class for GenericDAOTest and is intended
    ///to contain all GenericDAOTest Unit Tests
    ///</summary>
    [TestClass()]
    public class GenericDAOTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for update
        ///</summary>
        public void updateTestHelper<TEntity>()
            where TEntity : class
        {
            GenericDAO<TEntity> target = new GenericDAO<TEntity>(); // TODO: Initialize to an appropriate value
            TEntity entity = null; // TODO: Initialize to an appropriate value
            target.update(entity);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        [TestMethod()]
        public void updateTest()
        {
            updateTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for selectAll
        ///</summary>
        public void selectAllTestHelper<TEntity>()
            where TEntity : class
        {
            GenericDAO<TEntity> target = new GenericDAO<TEntity>(); // TODO: Initialize to an appropriate value
            List<TEntity> expected = null; // TODO: Initialize to an appropriate value
            List<TEntity> actual;
            actual = target.selectAll();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void selectAllTest()
        {
            selectAllTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for insert
        ///</summary>
        public void insertTestHelper<TEntity>()
            where TEntity : class
        {
            GenericDAO<TEntity> target = new GenericDAO<TEntity>(); // TODO: Initialize to an appropriate value
            TEntity entity = null; // TODO: Initialize to an appropriate value
            target.insert(entity);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        [TestMethod()]
        public void insertTest()
        {
            insertTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for delete
        ///</summary>
        public void deleteTestHelper<TEntity>()
            where TEntity : class
        {
            GenericDAO<TEntity> target = new GenericDAO<TEntity>(); // TODO: Initialize to an appropriate value
            TEntity entity = null; // TODO: Initialize to an appropriate value
            target.delete(entity);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        [TestMethod()]
        public void deleteTest()
        {
            deleteTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for GenericDAO`1 Constructor
        ///</summary>
        public void GenericDAOConstructorTestHelper<TEntity>()
            where TEntity : class
        {
            GenericDAO<TEntity> target = new GenericDAO<TEntity>();
            Assert.Inconclusive("TODO: Implement code to verify target");
        }

        [TestMethod()]
        public void GenericDAOConstructorTest()
        {
            GenericDAOConstructorTestHelper<GenericParameterHelper>();
        }
    }
}
